package com.zhang.controller.order;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhang.common.util.result.R;
import com.zhang.common.util.result.RUtils;
import com.zhang.order.entity.AppraiseReply;
import com.zhang.order.service.IAppraiseReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 商品评价的回复 前端控制器
 * </p>
 *
 * @author 创世神
 * @since 2024-04-20
 */
@RestController
@RequestMapping("/appraiseReply")
public class AppraiseReplyController {
    @Autowired
    private IAppraiseReplyService appraiseReplyService;

    @PostMapping
    public R addAppraiseReply(@RequestBody AppraiseReply appraiseReply) {
        appraiseReplyService.addAppraiseReply(appraiseReply);
        return RUtils.successMsg("回复成功");
    }

    @GetMapping("list")
    public R AppraiseReplyList(Map<String,Long> map) {
        Page<AppraiseReply> appraiseReplies = appraiseReplyService.AppraiseReplyList(map);
        return RUtils.successData(appraiseReplies);
    }
}
